<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="common/header.jsp" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<script src="${pageContext.request.contextPath}/statics/vendors/jquery/dist/jquery.js"></script>
<script src="${pageContext.request.contextPath}/statics/js/appinfo.js"></script>
<script src="${pageContext.request.contextPath}/statics/js/rollpage.js"></script>
<script src="${pageContext.request.contextPath}/statics/js/app_up_down.js"></script>
<div id="content">
    <div class="inner" style="min-height: 700px;">
            <!--Begin Select  SECTION -->
            <div class="row">
                <div class="col-lg-12">
                    <div >
                            <input type="hidden" name="pageIndex" value="1">
                            <!--Begin Title  SECTION -->
                            <div class="row">
                                <div class="col-lg-12">
                                    <h1> User Surface </h1>
                                </div>
                            </div>

                            <div class="col-lg-16">
                                <div style="height: 50px"></div>
                            </div>

                            <!--End Title  SECTION -->

                            <!--Begin Select  SECTION -->
                            <div class="row">
                                <div class="col-lg-12">
                                    <div style="text-align: center;">
                                        <!-- Begin Form -->
                                        <form method="post" action="${pageContext.request.contextPath}/dev/flatform/app/list" class="form-horizontal">
                                            <input type="hidden" name="pageIndex" value="1">
                                            <div class="col-lg-9">
                                            <div class="form-group">
                                                <label for="text1" class="control-label col-lg-2">软件名称</label>

                                                <div class="col-lg-2">
                                                    <input name="querySoftwareName" type="text" class="form-control" value="${querySoftwareName}">
                                                </div>

                                                <label for="text1" class="control-label col-lg-2">APP状态</label>

                                                <div class="col-lg-2">
                                                    <select name="queryStatus" class="form-control">
                                                        <c:if test="${statusList!=null}">
                                                            <option value="">---请选择---</option>
                                                            <c:forEach var="dataDictionary" items="${statusList}">
                                                                <option <c:if test="${dataDictionary.valueId == queryStatus }">selected="selected"</c:if>
                                                                        value="${dataDictionary.valueId}">${dataDictionary.valueName}</option>
                                                            </c:forEach>
                                                        </c:if>
                                                    </select>
                                                </div>

                                                <label for="text1" class="control-label col-lg-2">所属平台</label>

                                                <div class="col-lg-2">
                                                    <select name="queryFlatformId" class="form-control">
                                                        <c:if test="${flatFormList != null }">
                                                            <option value="">--请选择--</option>
                                                            <c:forEach var="dataDictionary" items="${flatFormList}">
                                                                <option <c:if test="${dataDictionary.valueId == queryFlatformId }">selected="selected"</c:if>
                                                                        value="${dataDictionary.valueId}">${dataDictionary.valueName}</option>
                                                            </c:forEach>
                                                        </c:if>
                                                    </select>
                                                </div>
                                            </div>

                                            <hr/>
                                             <hr/>


                                            <div class="form-group">
                                                <label for="text1" class="control-label col-lg-2">一级分类</label>

                                                <div class="col-lg-2">
                                                    <select id="queryCategoryLevel1" name="queryCategoryLevel1" class="form-control">
                                                        <c:if test="${categoryLevel1List != null }">
                                                            <option value="">--请选择--</option>
                                                            <c:forEach var="appCategory" items="${categoryLevel1List}">
                                                                <option <c:if test="${appCategory.id == queryCategoryLevel1 }">selected="selected"</c:if>
                                                                        value="${appCategory.id}">${appCategory.categoryName}</option>
                                                            </c:forEach>
                                                        </c:if>
                                                    </select>
                                                </div>

                                                <label for="text1" class="control-label col-lg-2">二级分类</label>

                                                <div class="col-lg-2">
                                                    <select name="queryCategoryLevel2" id="queryCategoryLevel2" class="form-control">
                                                        <c:if test="${queryCategoryLevel2 != null }">
                                                            <option value="">--请选择--</option>
                                                            <c:forEach var="appCategory" items="${categoryLevel2List}">
                                                                <option <c:if test="${appCategory.id == queryCategoryLevel2 }">selected="selected"</c:if>
                                                                        value="${appCategory.id}">${appCategory.categoryName}</option>
                                                            </c:forEach>
                                                        </c:if>
                                                    </select>
                                                </div>

                                                <label for="text1" class="control-label col-lg-2">三级分类</label>

                                                <div class="col-lg-2">
                                                    <select name="queryCategoryLevel3" id="queryCategoryLevel3" class="form-control">
                                                        <c:if test="${queryCategoryLevel3 != null }">
                                                            <option value="">--请选择--</option>
                                                            <c:forEach var="appCategory" items="${categoryLevel3List}">
                                                                <option <c:if test="${appCategory.id == queryCategoryLevel3 }">selected="selected"</c:if>
                                                                        value="${appCategory.id}">${appCategory.categoryName}</option>
                                                            </c:forEach>
                                                        </c:if>
                                                    </select>
                                                </div>
                                            </div>



<%--                                            <div class="form-group">--%>
<%--                                                <label for="text1" class="control-label col-lg-2">二级分类</label>--%>

<%--                                                <div class="col-lg-2">--%>
<%--                                                    <select name="queryCategoryLevel2" id="queryCategoryLevel2" class="form-control">--%>
<%--                                                        <c:if test="${queryCategoryLevel2 != null }">--%>
<%--                                                            <option value="">--请选择--</option>--%>
<%--                                                            <c:forEach var="appCategory" items="${categoryLevel2List}">--%>
<%--                                                                <option <c:if test="${appCategory.id == queryCategoryLevel2 }">selected="selected"</c:if>--%>
<%--                                                                        value="${appCategory.id}">${appCategory.categoryName}</option>--%>
<%--                                                            </c:forEach>--%>
<%--                                                        </c:if>--%>
<%--                                                    </select>--%>
<%--                                                </div>--%>
<%--                                            </div>--%>



<%--                                            <div class="form-group">--%>
<%--                                                <label for="text1" class="control-label col-lg-2">三级分类</label>--%>

<%--                                                <div class="col-lg-2">--%>
<%--                                                    <select name="queryCategoryLevel3" id="queryCategoryLevel3" class="form-control">--%>
<%--                                                        <c:if test="${queryCategoryLevel3 != null }">--%>
<%--                                                            <option value="">--请选择--</option>--%>
<%--                                                            <c:forEach var="appCategory" items="${categoryLevel3List}">--%>
<%--                                                                <option <c:if test="${appCategory.id == queryCategoryLevel3 }">selected="selected"</c:if>--%>
<%--                                                                        value="${appCategory.id}">${appCategory.categoryName}</option>--%>
<%--                                                            </c:forEach>--%>
<%--                                                        </c:if>--%>
<%--                                                    </select>--%>
<%--                                                </div>--%>
<%--                                            </div>--%>
                                            </div>
                                            <div class="col-lg-3">
                                                <div style="height: 12px"></div>
                                            </div>
                                          <div class="col-lg-1">
                                                <button class="btn btn-primary btn-lg btn-line btn-rect" type="submit">查&nbsp;&nbsp;&nbsp;&nbsp;询</button>
                                         </div>
                         </form>
                                        <!-- Eed Form -->
                    </div>
                </div>
            </div>
            <!-- Eed Select  SECTION -->
                            <div class="col-lg-9">
                                <hr />
                            </div>
            <div class="row">
                <div class="col-lg-12">
                    <div class="box">
                        <header>
                            <div class="col-lg-3">
                            <a href="${pageContext.request.contextPath}/dev/flatform/app/appinfoadd.html" class="btn btn-success btn-sm">新增APP基础信息</a>
                            </div>
                            <div class="toolbar">
                                <div class="btn-group">
                                    <a href="#sortableTable" data-toggle="collapse" class="btn btn-default btn-sm accordion-toggle minimize-box">
                                        <i class="icon-chevron-up"></i>
                                    </a>
                                </div>
                            </div>
                        </header>
                        <div id="sortableTable" class="body collapse in">
                            <table class="table table-bordered sortableTable responsive-table">
                                <thead>
                                <tr>
                                    <th>软件名称<i class="icon-sort"></i><i class="icon-sort-down"></i> <i class="icon-sort-up"></i></th>

                                    <th>APK名称<i class="icon-sort"></i><i class="icon-sort-down"></i> <i class="icon-sort-up"></i></th>

                                    <th>软件大小(单位:M)<i class="icon-sort"></i><i class="icon-sort-down"></i> <i class="icon-sort-up"></i></th>

                                    <th>所属平台<i class="icon-sort"></i><i class="icon-sort-down"></i> <i class="icon-sort-up"></i></th>

                                    <th>所属分类(一级分类、二级分类、三级分类)<i class="icon-sort"></i><i class="icon-sort-down"></i> <i class="icon-sort-up"></i></th>

                                    <th>状态<i class="icon-sort"></i><i class="icon-sort-down"></i> <i class="icon-sort-up"></i></th>

                                    <th>下载次数<i class="icon-sort"></i><i class="icon-sort-down"></i> <i class="icon-sort-up"></i></th>

                                    <th>最新版本号<i class="icon-sort"></i><i class="icon-sort-down"></i> <i class="icon-sort-up"></i></th>
                                    <th style="width:130px;">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <c:forEach var="appInfoList" items="${appInfoList}">
                                    <tr>
                                        <td>${appInfoList.softwareName}</td>
                                        <td>${appInfoList.APKName}</td>
                                        <td>${appInfoList.softwareSize}</td>
                                        <td>${appInfoList.flatformName}</td>
                                        <td>${appInfoList.categoryLevel1Name}-\-${appInfoList.categoryLevel2Name}-\-${appInfoList.categoryLevel3Name}</td>
                                        <td><span id="appInfoStatus${appInfoList.id}">${appInfoList.statusName }</span></td>
                                        <td>${appInfoList.downloads}</td>
                                        <td>${appInfoList.versionNo}</td>
                                        <td>
                                            <div class="btn-group">
                                                <button type="button" class="btn btn-danger">点击操作</button>
                                                <button type="button" class="btn btn-danger dropdown-toggle"
                                                        data-toggle="dropdown" aria-expanded="false">
                                                    <span class="caret"></span>
                                                    <span class="sr-only">切换</span>
                                                </button>
                                                <ul class="dropdown-menu" role="menu">
                                                    <c:if test="${appInfoList.status!=4&&appInfoList.status!=3&&appInfoList.status!=1}">
                                                        <li>
                                                            <a class="saleSwichOpen upapp" saleSwitch="open" appinfoid=${appInfoList.id }  appsoftwarename=${appInfoList.softwareName }
                                                               data-toggle="tooltip" data-placement="top" title=""
                                                               data-original-title="上架">上架</a>
                                                        </li>
                                                    </c:if>
                                                    <c:if test="${appInfoList.status!=5&&appInfoList.status!=3&&appInfoList.status!=1}">
                                                        <li>
                                                            <a class="saleSwichClose downapp" saleSwitch="close" appinfoid=${appInfoList.id }  appsoftwarename=${appInfoList.softwareName }
                                                               data-toggle="tooltip" data-placement="top" title=""
                                                               data-original-title="下架">下架</a>
                                                        </li>
                                                    </c:if>
                                                    <li>
                                                        <a href="/dev/flatform/app/appversionadd.html?appid=${appInfoList.id}" data-toggle="tooltip" data-placement="top" title=""
                                                           data-original-title="新增APP版本信息">新增版本</a>
                                                    </li>
                                                    <li>
                                                        <a class="modifyVersion" status="${appInfoList.status}" appinfoid="${appInfoList.id}" versionid="${appInfoList.versionId}"
                                                           data-toggle="tooltip" data-placement="top" title=""
                                                           data-original-title="修改APP版本信息">修改版本</a>
                                                    </li>
                                                    <li>
                                                        <a class="modifyAppInfo" statusname=""${appInfoList.statusName} status="${appInfoList.status}" appinfoid="${appInfoList.id }" data-toggle="tooltip" data-placement="top" title=""
                                                           data-original-title="修改APP基础信息">修改</a>
                                                    </li>
                                                    <li>
                                                        <a class="viewApp" appinfoid="${appInfoList.id }" data-toggle="tooltip" data-placement="top" title=""
                                                           data-original-title="查看APP基础信息以及全部版本信息">查看</a>
                                                    </li>
                                                    <li>
                                                        <a class="deleteApp" appinfoid="${appInfoList.id}" appsoftwarename="${appInfoList.softwareName}" data-toggle="tooltip" data-placement="top" title=""
                                                           data-original-title="删除APP基础信息以及全部版本信息">删除</a>
                                                    </li>
                                                </ul>
                                            </div>
                                        </td>
                                    </tr>
                                </c:forEach>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="col-sm-5">
                        <div class="dataTables_info" id="datatable-responsive_info"
                             role="status" aria-live="polite">
                            共${totalCount}条记录 ${currentPageNo}/${totalPageCount}页
                        </div>
                    </div>
                    <div class="col-sm-7">
                        <div class="dataTables_paginate">
                            <ul class="pagination">
                                <c:if test="${currentPageNo>1}">
                                    <li >
                                        <a href="javascript:page_nav(document.forms[0],1);" class="btn btn-default btn-sm btn-line">首页</a>
                                    </li>
                                    <li >
                                        <a href="javascript:page_nav(document.forms[0],${pages.currentPageNo-1});" class="btn btn-default btn-sm btn-line">上一页</a>
                                    </li>
                                </c:if>
                                <c:if test="${totalPageCount>currentPageNo}">
                                    <li >
                                        <a href="javascript:page_nav(document.forms[0],${pages.currentPageNo+1});" class="btn btn-default btn-sm btn-line">下一页</a>
                                    </li>
                                    <li >
                                        <a href="javascript:page_nav(document.forms[0],${totalPageCount});" class="btn btn-default btn-sm btn-line">最后一页</a>
                                    </li>
                                </c:if>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
    </div>
</div>
<%@include file="common/footer.jsp" %>
<script src="${pageContext.request.contextPath}/statics/js/rollpage.js"></script>
<script src="${pageContext.request.contextPath}/statics/js/appinfo.js"></script>